package org.sgx.gwteditors.testgallery.gallery;

import java.util.Map;

import org.sgx.gwteditors.client.impl1.basetypes.Color;
import org.sgx.gwteditors.client.impl1.simple.ColorEditor;
import org.sgx.gwteditors.client.util.TestUtil;

import com.google.gwt.resources.client.ExternalTextResource;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;

public class ColorEditorTest implements Test {	
	
	@Override
	public void test(Panel parent) {
		FlexTable ft = new FlexTable();
		
		Color c1 = new Color(20,30,122);
		ColorEditor ed1 = new ColorEditor();
		ed1.load(c1);
		
		ft.setWidget(0, 0, new Label("select color: "));
		ft.setWidget(0, 1, ed1);
		
		parent.add(ft);
	}

	
	//test stuff
	@Override
	public String getName() {
		return "color";
	}

	@Override
	public String[] getTags() {		
		return null;
	}

	@Override
	public String getDescription() {
		return "simple color editor usecase";
	}
	@Override
	public Map<String, ExternalTextResource> getJavaSources() {
		return TestUtil.getResource(getName(), TestResources.INSTANCE.ColorEditorTest());
	}
	
//	@Override
//	public String[] getJavaSources() {
//		return new String[]{TestResources.INSTANCE.ColorEditorTest().getText()};
//	}
}
